package com.senchen365.orderms.web.servlet;

import com.senchen365.multiprj.service.OrderService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * <p> Title: OrderServlet </p>
 * <p> Description:web中操作order的servlet </p>
 *
 * @author ： 森晨科技
 * @version ：  1.00
 * 修改记录 ：
 *
 * <pre>
 * 版本   修改人    修改时间    修改内容描述
 * ----------------------------------------
 *
 * </pre>
 * @date： 2021/11/30
 */
@WebServlet("/orderServlet.do")
public class OrderServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        OrderService orderService = new OrderService();
        String msg = orderService.showOrder();
        resp.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset=utf-8");
        PrintWriter out = resp.getWriter();
        out.print("<h2>"+msg+"</h2>");
        out.flush();
        out.close();

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
